package cn.juque.abstractfactory;

import cn.juque.abstractfactory.entity.ModelY;
import cn.juque.abstractfactory.entity.Ocean;
import cn.juque.abstractfactory.factory.BaseFactory;
import cn.juque.abstractfactory.factory.BydFactory;
import cn.juque.abstractfactory.factory.TeslaFactory;
import cn.juque.abstractfactory.service.BydEnum;
import cn.juque.methodfactory.service.ModelEnum;
import cn.juque.simplefactory.product.Car;

/**
 * @author juque
 * @version 1.0.0
 * <ul>
 *     <li>MainMethod</li>
 * </ul>
 * @date 2023-06-11 14:53:53
 **/
public class MainMethod {

    public static void main(String[] args) {
        Car car = BaseFactory.render(TeslaFactory.class, ModelEnum.MODEL_Y.getModel());
        ModelY modelY = (ModelY) car;
        System.out.println("create a tesla:" + modelY.getName());
        car = BaseFactory.render(BydFactory.class, BydEnum.OCEAN.getModel());
        Ocean ocean = (Ocean) car;
        System.out.println("create a tesla:" + ocean.getName());
    }
}
